home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 255_01 / fardemo.c < prev    next >
Text File  |  1988-03-28  |  2KB  |  71 lines

  1. /*                                          */
  2. /*  Program:     Demo, Version 01/20/86                       */
  3. /*                                          */
  4. /*  Description: Demonstrate calling by EGA routines using FAR calls.          */
  5. /*                                          */
  6. /*  Author:     Kent Cedola                              */
  7. /*         2015 Meadow Lake Court, Norfolk VA, 23518. 1-(804)-857-0613  */
  8. /*                                          */
  9. /*  Language:     Microsoft C 4.0+                          */
  10. /*                                          */
  11.  
  12. #include <stdio.h>
  13. #include <mcega.h>
  14.  
  15.  
  16. void InitGraphics()
  17. {
  18.  
  19.   GPPARMSX();                   /* Sets up all global variables */
  20.  
  21.   if (GDTYPE == 4)               /* Give monochrome user bad news */
  22.     {
  23.     perror("Sorry, must have a Color Display not monochrome!\n");
  24.     exit(1);
  25.     }
  26.   else if (GDTYPE != 5)         /* Tell non-EGA users no can run */
  27.     {
  28.     perror("Enhanced Color Adapter and Display not found!");
  29.     exit(2);
  30.     };
  31.  
  32.   if (GDMEMORY == 64)            /* We need lots of EGA memory    */
  33.     {
  34.     perror("This program will work much better with 128k+ EGA memory!\n");
  35.     perror("       Hit any key to continue!\n");
  36.     getch();
  37.     };
  38.  
  39.   GPINITX();                   /* We are now in graphic mode!  */
  40.  
  41.  
  42. }
  43.  
  44. void TermGraphics()
  45. {
  46.  
  47.   GPTERMX();                   /* Terminate graphic mode       */
  48.  
  49. }
  50.  
  51. main(argc, argv)
  52.   int  argc;
  53.   char **argv;
  54. {
  55.  
  56.   InitGraphics();
  57.  
  58.   GPCOLORX(WHITE);
  59.   GPMOVEX(0,0);
  60.   GPBOXX(GDMAXCOL,GDMAXROW);
  61.  
  62.   GPCOLORX(RED);
  63.  
  64.   GPMOVEX(0, 0);
  65.   GPLINEX(639, 349);
  66.  
  67.   getch();
  68.  
  69.   TermGraphics();
  70. }
  71.